<?php

/**
 * Description of FeedWriter
 *
 * @author a.novikov
 */
class FeedWriter extends Zend_Feed_Writer_Feed {
	public function addFromRowset(Db_Rowset $rowset, $type = NULL) {
		foreach ($rowset as $row) {
			if (!$row instanceof IRssFeedElementProvider) {
				throw new Exception('Interface IRssFeedElementProvider not implemented');
			}
			$row->addRssFeedElement($this, $type);
		}
	}

	public function addFromBlogRowset(Db_Rowset $rowset, $type = NULL) {
		foreach ($rowset as $row) {
			$row->addRssFeedElement($this, $type);
		}
	}
}
